// --------------------------------------------------------------------------------------------------------------------
// <copyright file="CommandId.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Microsoft.Robotics.Hardware.EV4
{
    using System.Diagnostics.CodeAnalysis;

    /// <summary>
    /// Valid command ids.
    /// </summary>
    [SuppressMessage("Microsoft.Design", "CA1027:MarkEnumsWithFlags", Justification = "Not flags")]
    public enum CommandId
    {
        /// <summary>
        /// Unused command
        /// </summary>
        Unused0 = 0x00, 

        /// <summary>
        /// Heartbeat from device to host
        /// </summary>
        DeviceHeartbeat = 0x01, 

        /// <summary>
        /// Heartbeat from host to device
        /// </summary>
        HostHeartbeat = 0x02, 

        /// <summary>
        /// Get raw sensor data 
        /// </summary>
        ReadRawData = 0x03, 

        /// <summary>
        /// Get firmware configuration information 
        /// </summary>
        GetConfig = 0x04, 

        /// <summary>
        /// Puts the projector in and out of idle mode 
        /// </summary>
        SetProjectorIdleMode = 0x07, 

        /// <summary>
        /// Begin reflashing  
        /// </summary>
        InitReflash = 0x08, 

        /// <summary>
        /// Send a reflashing block  
        /// </summary>
        ReflashBlock = 0x09, 

        /// <summary>
        /// Set relative power of cooling fans  
        /// </summary>
        FanPower = 0x0A, 

        /// <summary>
        /// Set relative power of cooling fans  
        /// </summary>
        MotorParameter = 0x0B, 

        /// <summary>
        /// An ErrorReport message is sent from the drive/head board to the host
        ///   to signal an error / alert (e.g. thermal warning).
        /// It is not tied to a specific request.
        /// It contains a 4-byte ResponseCode value as its parameter block.
        /// Its cmdResponse value is 0.
        /// Its sequence number value is 0.
        /// Sometimes additional information is OR-ed into the parameter block.  
        /// </summary>
        ErrorReport = 0x0C, 

        /// <summary>
        /// Calibrate Servo  
        /// </summary>
        RecalibrateServo = 0x0D, 

        /// <summary>
        /// Control power bus state  
        /// </summary>
        SetPowerState = 0x0F, 

        /// <summary>
        /// Reset the cliff state stoppage caused by the category 2 circuit firing.
        /// </summary>
        ResetCliffStoppage = 0x10, 

        /// <summary>
        /// Set gain of microphone array pre-amplifiers
        /// </summary>
        MicrophoneGain = 0x11, 

        /// <summary>
        /// Turn on or off the bump sensing feature
        /// </summary>
        SetBumpSensing = 0x12, 

        /// <summary>
        /// Reset the bump detected event
        /// </summary>
        ResetBumpDetected = 0x13, 

        /// <summary>
        /// Reset the controller board  
        /// </summary>
        ResetIoBoard = 0x14, 

        /// <summary>
        /// Trigger reset of PC  
        /// </summary>
        ResetMotherboard = 0x15, 

        /// <summary>
        /// Turn device heart beat on/off  
        /// </summary>
        ToggleHeartbeat = 0x16, 

        /// <summary>
        /// Set Drive Velocities
        /// </summary>
        SetDriveVelocities = 0x17, 

        /// <summary>
        /// Set Timed Drive Velocities
        /// </summary>
        SetTimedDriveVelocities = 0x18, 

        /// <summary>
        /// Set servo position in radians
        /// </summary>
        SetServoRadians = 0x19, 

        /// <summary>
        /// Set holding current or not when servo is stopped.
        /// </summary>
        SetServoHoldingCurrent = 0x1A, 

        /// <summary>
        /// Soon to be obsolete  
        /// </summary>
        GetUnitInfo = 0x1B, 

        /// <summary>
        /// Reset encoder/step count on drive motors  
        /// </summary>
        ResetMotorPos = 0x1C, 

        /// <summary>
        /// Soon to be obsolete  
        /// </summary>
        GetSensorInfo = 0x1D, 

        /// <summary>
        /// Turn sonars on  
        /// </summary>
        SonarMode = 0x1E, 

        /// <summary>
        /// Set relative power of cooling fans
        /// </summary>
        DepthCamPower = 0x1F, 

        /// <summary>
        /// Set RGB values of LEDs in face ring
        /// </summary>
        SetFaceRingLeds = 0x20, 

        /// <summary>
        /// Set RGB values of LEDs in visor
        /// </summary>
        SetSensoryLeds = 0x21, 

        /// <summary>
        /// Move the focus motor  
        /// </summary>
        SetProjectorFocus = 0x22, 

        /// <summary>
        /// Set the projector brightness
        /// </summary>
        SetProjectorBrightness = 0x23, 

        /// <summary>
        /// Sync the projector's video signal to the PC's video signal
        /// </summary>
        SyncProjectorSignal = 0x24, 

        /// <summary>
        /// Sets vertical and horizontal image inversion
        /// </summary>
        SetProjectorInversion = 0x25, 

        /// <summary>
        /// Gets the version number of the projector
        /// </summary>
        GetProjectorVersion = 0x26, 

        /// <summary>
        /// Turns the projector on or off
        /// </summary>
        SetProjectorPower = 0x27, 

        /// <summary>
        /// Moves the vertical image of the projector
        /// </summary>
        MoveProjectorVerticalImage = 0x28, 

        /// <summary>
        /// Move the projector focus back to the home position (interval focus)
        /// </summary>
        GoToProjectorHomePosition = 0x2A, 

        /// <summary>
        /// Open the shutter to allow rear projection
        /// </summary>
        OpenProjectorShutter = 0x2B, 

        /// <summary>
        /// Close the shutter for internal projection
        /// </summary>
        CloseProjectorShutter = 0x2C, 

        /// <summary>
        /// Set new calibration parameters
        /// </summary>
        SetCalibrationParams = 0x2D, 

        /// <summary>
        /// Get the current calibration parameters
        /// </summary>
        GetCalibrationParams = 0x2E, 

        /// <summary>
        /// Commit calibration parameters to FLASH
        /// </summary>
        CommitCalibrationParams = 0x2F, 

        /// <summary>
        /// Zero all calibration parameters for both RAM and FLASH
        /// </summary>
        ZeroAllCalibrationParams = 0x30, 

        /// <summary>
        /// Set the calibration offset for a given proximity sensor.
        /// </summary>
        SetProximityCalibrationOffsets = 0x31, 

        /// <summary>
        /// Set the calibration offset for a given cliff sensor.
        /// </summary>
        SetCliffSensorCalibrationOffsets = 0x32, 

        /// <summary>
        /// Set the calibration offset for a given accelerometer axis.
        /// </summary>
        SetAccelerometerCalibrationOffsets = 0x33, 

        /// <summary>
        /// Set the calibration offset for a given gyroscope axis.
        /// </summary>
        SetGyroscopeCalibrationOffsets = 0x34, 

        /// <summary>
        /// Set the calibration offset for a given servo motor.
        /// </summary>
        SetServoCalibrationOffset = 0x35, 

        /// <summary>
        /// Set the projector home calibration position
        /// </summary>
        SetProjectorHomeCalibrationPosition = 0x36, 

        /// <summary>
        /// Set the calibration offset for a given compass axis.
        /// </summary>
        SetCompassCalibrationOffsets = 0x37, 

        /// <summary>
        /// Set the bump sensing threshold (in G).
        /// </summary>
        SetBumpSensingThreshold = 0x38, 

        /// <summary>
        /// Drive with charger attached
        /// </summary>
        DriveWithCharger = 0x3A, 

        /// <summary>
        /// Sets a sequence to perform on a motor
        /// </summary>
        SetServoSequence = 0x3B, 

        /// <summary>
        /// Configures the PID loop for a motor.
        /// </summary>
        ConfigPid = 0x3C, 

        /// <summary>
        /// Set RGB values of LEDs in face ring for a timed period(less than 1 second)
        /// </summary>
        SetTimedFaceRingLeds = 0x3D, 

        /// <summary>
        /// Set RGB values of LEDs in visor for a timed period(less than 1 second)
        /// </summary>
        SetTimedSensoryLeds = 0x3E, 

        /// <summary>
        /// Total number of commands
        /// </summary>
        CommandCount = 0x3F, 

        /// <summary>
        /// Ignore host heartbeats
        /// </summary>
        HostHeartbeatIgnore = 0x05, 

        /// <summary>
        /// Enable cliff detection
        /// </summary>
        CliffDetectionEnable = 0x06
    }
}
